import { Message, Modal } from "@arco-design/web-vue"

export const useMessage = {
    success: (tips?: string) => {
        Message.clear()
        Message.success({ content: tips || t('hooks.message.60zenfbn7340'), position: 'top', duration: 1000 })
    },
    warning: (tips: string) => {
        Message.clear()
        Message.warning({ content: tips, position: 'top', duration: 1000 })
    },
    info: (tips: string) => {
        Message.clear()
        Message.info({ content: tips, position: 'top', duration: 1000 })
    },
    normal: (tips: string) => {
        Message.clear()
        Message.normal({ content: tips, position: 'top', duration: 1000 })
    },
    error: (tips: string) => {
        Message.clear()
        Message.error({ content: tips, position: 'top', duration: 1000 })
    },
    loading: (tips: string) => {
        Message.clear()
        Message.loading({ content: tips || t('hooks.message.60zenfbn9110') + '...', position: 'top', duration: 0 })
    },
    clear: () => Message.clear(),
}
export const useModal = {
    info: (options: any) => {
        Modal.info({
            title: t('hooks.message.60zenfbn94o0'),
            width: 300,
            titleAlign: 'center',
            hideCancel: false,
            okText: t('hooks.message.60zenfbn9100'),
            cancelText: t('hooks.message.60zenfbn92s0'),
            okButtonProps: {
                size: 'small'
            },
            cancelButtonProps: {
                size: 'small'
            },
            bodyStyle: {
                textAlign: 'center'
            },
            ...options
        });
    },
    warning: (options: any) => {
        Modal.warning({
            title: t('hooks.message.60zenfbn94o0'),
            width: 300,
            titleAlign: 'center',
            hideCancel: false,
            okText: t('hooks.message.60zenfbn9100'),
            cancelText: t('hooks.message.60zenfbn92s0'),
            bodyStyle: {
                textAlign: 'center'
            },
            ...options
        });
    }
}